﻿<!--
<copyright file="InputSequenceItem.xaml" company="Microsoft">
    // Copyright (c) Microsoft Corporation.  All rights reserved.
</copyright>
<summary>
    // Usercontrol which will hold details of one query region selection.
</summary> 
    -->
<UserControl x:Class="BioExcel.Visualizations.Common.InputSequenceItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             d:DesignWidth="400">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/Styles.xaml" />
                <ResourceDictionary Source="../Resources/ResourceDictionary.xaml" />

                <ResourceDictionary>
                    <Style x:Key="showSelectionHelperButton" TargetType="{x:Type Button}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border x:Name="border" Background="#FFE8F4FA" BorderBrush="#FF778E9D" BorderThickness="1" CornerRadius="3">
                                        <Canvas>
                                            <Rectangle Fill="#FF14367E" Stroke="{x:Null}" Width="4" Height="4" Canvas.Left="2" Canvas.Top="2"/>
                                            <Path Fill="#FF7BA0B9" Stretch="Fill" Stroke="{x:Null}" Width="14" Height="14" Canvas.Left="2" Canvas.Top="2" Data="M5,0 L9,0 L9,4 L5,4 z M10,0 L14,0 L14,4 L10,4 z M0,5 L4,5 L4,9 L0,9 z M5,5 L9,5 L9,9 L5,9 z M10,5 L14,5 L14,9 L10,9 z M0,10 L4,10 L4,14 L0,14 z M5,10 L9,10 L9,14 L5,14 z M10,10 L14,10 L14,14 L10,14 z"/>
                                            <Path Fill="#FFE00000" Stretch="Fill" Stroke="Snow" Width="10.245" Height="10.25" Canvas.Left="4.419" Canvas.Top="4.404" Data="M0,0 L6.8330003,0 5.1181274,1.7148727 10.034555,6.6313 6.6262999,10.039555 1.7098729,5.1231275 0,6.8330002 z"/>
                                        </Canvas>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsFocused" Value="True">
                                            <Setter Property="BorderBrush" TargetName="border" Value="#FF4D7590"/>
                                        </Trigger>
                                        <Trigger Property="IsDefaulted" Value="True"/>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" TargetName="border" Value="#FFF0EDCB"/>
                                            <Setter Property="BorderBrush" TargetName="border" Value="#FF9D8577"/>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter Property="BorderBrush" TargetName="border" Value="#FFA1755B"/>
                                            <Setter Property="Background" TargetName="border" Value="#FFF6EFA2"/>
                                        </Trigger>
                                        <Trigger Property="IsEnabled" Value="False"/>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <Style x:Key="closeButton" TargetType="{x:Type Button}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                    <Border x:Name="border" Background="#FF720000" BorderBrush="#FF430000" BorderThickness="1" CornerRadius="3">
                                        <Canvas>
                                            <Path Fill="White" Stretch="Fill" Stroke="{x:Null}" Width="10" Height="10" RenderTransformOrigin="0.5,0.5" Canvas.Left="2.2" Canvas.Top="2" Data="M4.5,0 L7.5,0 7.5,4.5 12,4.5 12,7.5 7.5,7.5 7.5,12 4.5,12 4.5,7.5 0,7.5 0,4.5 4.5,4.5 z">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform/>
                                                        <SkewTransform/>
                                                        <RotateTransform Angle="-45"/>
                                                        <TranslateTransform/>
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                        </Canvas>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsFocused" Value="True">
                                            <Setter Property="BorderBrush" TargetName="border" Value="#FFBB3200"/>
                                        </Trigger>
                                        <Trigger Property="IsDefaulted" Value="True"/>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Background" TargetName="border" Value="#FFBD1515"/>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter Property="Background" TargetName="border" Value="#FF8C3333"/>
                                        </Trigger>
                                        <Trigger Property="IsEnabled" Value="False"/>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>

                    <LinearGradientBrush x:Key="ErrorItemBackground" Opacity="1" StartPoint="1,0" EndPoint="1,1">
                        <GradientStop Color="#10DC1400" Offset="-.2" />
                        <GradientStop Color="#CBDC0000" Offset=".2" />
                        <GradientStop Color="Transparent" Offset="2" />
                    </LinearGradientBrush>

                    <LinearGradientBrush x:Key="NormalItemBackground" Opacity="1" StartPoint="1,0" EndPoint="1,1">
                        <GradientStop Color="#3C2872C4" Offset="-.2" />
                        <GradientStop Color="#162872C4" Offset="1" />
                    </LinearGradientBrush>

                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border x:Name="backgroundBorder" Background="{StaticResource NormalItemBackground}" ClipToBounds="True" BorderThickness="0,.5,0,.5" BorderBrush="#AA2872C4">
        <!--#72FF0000-->
        <StackPanel Orientation="Vertical">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="277*" />
                    <ColumnDefinition Width="auto" />
                    <ColumnDefinition Width= "20" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <TextBlock x:Name="sequenceBoxLabel" Margin="10,5,5,0" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Text="{DynamicResource InputSequenceItem_Sequence}" VerticalAlignment="Top" />
                <TextBox Height="auto" x:Name="sequenceAddressBox" VerticalAlignment="Top" Margin="15,22,0,0" HorizontalAlignment="Stretch"/>
                <Button x:Name="sequenceSelectionHelper" Style="{DynamicResource showSelectionHelperButton}" FontSize="12" Grid.Row="0" Grid.Column="1" Height="20" Width="20" Margin="0,16,0,0" Click="OnSelectFromSheetClick" />
                <Button x:Name="deleteItemButton" Style="{DynamicResource closeButton}" Width="16" Height="16" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,3,2,0" Click="OnRemoveItemClick" />
                <CheckBox x:Name="chkUseMetadata" Margin="15,0,0,0" Content="{DynamicResource InputSequenceItem:UseMetadataCheckBoxlabel}" Grid.Row="1" Visibility="Collapsed" />

            </Grid>
            <Grid x:Name="sequenceMetadataGrid" Grid.Row="1" Visibility="Collapsed" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="277*" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width= "20" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                </Grid.RowDefinitions>

                <TextBlock x:Name="metadataBoxLabel"  Margin="10,5,5,0" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Text="{DynamicResource InputSequenceItem_Metadata}" VerticalAlignment="Top" />
                <TextBox Height="auto" HorizontalAlignment="Stretch" x:Name="sequenceMetadata" VerticalAlignment="Top" Grid.Column="0" Grid.Row="1" Margin="15,22,0,0"/>
                <Button x:Name="metadataSelectionHelper" Style="{DynamicResource showSelectionHelperButton}" FontSize="12" Grid.Row="0" Grid.Column="1" Height="20" Width="20" Margin="0,16,0,0" Click="OnSelectFromSheetClick" />
            </Grid>

            <Grid x:Name="sequenceNameGrid" Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="277*" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width= "20" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="50" />
                </Grid.RowDefinitions>

                <TextBlock Margin="10,5,5,0" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Text="{DynamicResource InputSequenceItem_Name}" VerticalAlignment="Top" />
                <TextBox Height="auto" HorizontalAlignment="Stretch" x:Name="sequenceID" VerticalAlignment="Top" Grid.Column="0" Grid.Row="1" Margin="15,22,0,0"/>
            </Grid>
        </StackPanel>
    </Border>
</UserControl>
